<template>
  <div class="container tag-class" @click="onTap">
    <span>{{text}}</span>
    <slot></slot>
  </div>
</template>

<script>
export default {
  name: 'BookTag',
  props: {
    text: String
  },
  methods: {
    onTap () {
      this.$emit('tapping', this.text)
    }
  }
}
</script>

<style lang="stylus" scoped>
  .container
    padding: .12rem .12rem
    background-color: #f5f5f5
    color: #666666
    border-radius: .02rem
    margin: .2rem 0 0 0
    display: inline-flex
    flex-direction: row
    align-items: center
    justify-content: center
    font-size: .28rem
</style>
